﻿
@using Apps.Common;
@using Apps.Models.Sys;
@using Apps.Web.Core;

@model Apps.Models.Sys.MIS_ArticleModel

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";

    List<PermModel> perm = ViewBag.perm;
    if (perm == null)
    {
        perm = new List<PermModel>();
    }
}

<script type="text/javascript">
    $(function () {
        $('#btnSave').click(function () {
            $.ajax({
                url: '@Url.Action("Create")',
                type: 'post',
                data: $('#CreateForm').serialize(),
                dataType: 'json',
                success: function (data) {
                    if (data.tag == 1) {
                        window.parent.frameReturnByMes(data.message);
                        window.parent.frameReturnByReload(true);
                        window.parent.frameReturnByClose()
                    } else {
                        window.parent.frameReturnByMes(data.message);
                    }
                }
            });
        });
        $("#btnReturn").click(function () {
            window.parent.frameReturnByClose();
        });

    });

</script>


<div class="mvctool bgb">
    @Html.ToolButton("btnSave", "icon-save", "保存", true, perm, "Save")
    @Html.ToolButton("btnReturn", "icon-return", "返回", false)
</div>

@using (Html.BeginForm("Create", "MIS/MyArticle", null, FormMethod.Post, new { id = "CreateForm" }))
{
    <table class="fromEditTable setTextWidth300">
        <tbody>
            <tr>
                <td style="width:100px; text-align:right;">
                    @Html.LabelFor(model => model.CategoryId)：
                </td>
                <td style="width:310px">
                    @Html.EditorFor(model => model.CategoryId)
                </td>
            </tr>
            <tr>
                <td style="width:100px; text-align:right;">
                    @Html.LabelFor(model => model.Title)：
                </td>
                <td style="width:310px">
                    @Html.EditorFor(model => model.Title)
                </td>
            </tr>
            <tr>
                <td style="width:100px; text-align:right;">
                    @Html.LabelFor(model => model.ImgUrl)：
                </td>
                <td style="width:310px">
                    @Html.EditorFor(model => model.ImgUrl)
                </td>
            </tr>
            <tr>
                <td style="width:100px; text-align:right;">
                    @Html.LabelFor(model => model.BodyContent)：
                </td>
                <td style="width:310px">
                    @Html.EditorFor(model => model.BodyContent)
                </td>
            </tr>

        </tbody>
    </table>
}

